<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('鸡入库列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row" id="printArea">
        <div>
            <div>
                <form id="formId">
                    <!--  <div class="select-list">-->
                    <input type="hidden" name="orderId" th:value="${orderId}"/>
                    <!--  </div>-->
                </form>
            </div>

        </div>

        <h3 align="center"> <span th:text="${order.orderCode}+鸡入库单" id="ordercode" hidden="hidden"></span> </h3>

        <div class="col-sm-12 select-table table-striped">
            <h3>入库单号：&nbsp;&nbsp;<span th:text="${order.orderCode}"></span>&nbsp;&nbsp;入库时间:&nbsp;&nbsp;<span data-format="yyyy-MM-dd HH:mm:ss"  th:text="*{#dates.format(order.createTime, 'yyyy-MM-dd HH:mm:ss')}"></span>&nbsp;&nbsp;入库经手人:&nbsp;&nbsp;<span th:text="${order.createBy}"></span></h3>

            <div class="btn-group-sm" id="toolbar" role="group">

                <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ncInputChicken:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncInputChicken:export">
                    <i class="fa fa-download"></i> 导出
                </a>
                <a class="btn btn-warning" id="print-btn" orderType = "12">
                    <i class="fa fa-download"></i> 打印
                </a>
            </div>
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
            <h3> <span class="fl-l" id="autograph" hidden="hidden"></span> </h3>
        </div>

    </div>
    <div class="bottom-btns"></div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncInputChicken:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncInputChicken:remove')}]];
    var prefix = ctx + "system/ncInputChicken";
    //入栏鸡品种
    var chickentype= [[${@dict.getType('chicken_type')}]];
    //检疫合格证
    var chickenIsHege=[[${@dict.getType('chickenIsHege')}]];
    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "鸡入库",
            showExport: false,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            toolbar: 'toolbar1',
            columns: [
                {
                    title: '序号',
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field : 'inputVarieties',
                    title : '入栏鸡品种',
                    sortable: true,
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(chickentype, value);
                    }
                },
                {
                    field : 'supplier',
                    title : '供应商',
                    sortable: true
                },
                {
                    field : 'isHege',
                    title : '检疫合格证（有/无）',
                    sortable: true,
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(chickenIsHege, value);
                    }

                },
                {
                    field : 'inputAmount',
                    title : '数量（只）',
                    sortable: true
                },
                {
                    field : 'inputTime',
                    title : '入栏时间',
                    sortable: true
                },
                {
                    field : 'inputUser',
                    title : '入栏经手人',
                    sortable: true
                },
                /*{
                    field : 'createBy',
                    title : '创建者',
                    sortable: true
                },
                {
                    field : 'createTime',
                    title : '创建时间',
                    sortable: true
                },*/
                {
                    field : 'remark',
                    title : '备注',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inputId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.inputId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    /*表单确认*/

    function reload() {
        window.location.reload()
    }
</script>
</body>
</html>